#version 1; November 2025
#Assumes laser has been connected with it.connect(x,9600)
#Assumes PPCL600 (or PPCL500) or PPCL700 (or PPCL550) device with recent firmware (within last 2 yrs)
#Run with: it.script("examples\\DownloadDeviceMemory.txt")
#---- Settings
outputfile="devicememory.log"
#-----

import time

temp=it.serNo()[1][1]
f=open(temp+"_"+outputfile,"w")

it.pwr()
readpacket=it.toModulePacket()
readpacket.register(0xfd)

counter=0
while counter<0x500:
    readpacket.data(0xb000+0x400+counter)
    temp1=it.packet(readpacket).data()
    f.write("Field %d Data %d " %(counter,temp1/256))
    f.write("\\n")
    counter=counter+1

f.close()

print("Collected Memory Information on unit %s" %temp)